package com.ai.entity;

import lombok.Data;

import java.util.List;

@Data
public class UploadResponse {
    private boolean success;
    private String message;
    private String url;
    private Long size;
    private String fileName;

    private List<Integer> uploadedChunks; // 已上传的分片索引
    private List<Integer> missingChunks;  // 缺失的分片索引
    private Integer totalChunks; // 总分片数
    private Long uploadedSize; // 已上传总大小
    private Boolean isResumable; // 是否可续传
    
    public static UploadResponse success(String message, String url, Long size, String fileName) {
        UploadResponse response = new UploadResponse();
        response.setSuccess(true);
        response.setMessage(message);
        response.setUrl(url);
        response.setSize(size);
        response.setFileName(fileName);
        return response;
    }
    
    public static UploadResponse error(String message) {
        UploadResponse response = new UploadResponse();
        response.setSuccess(false);
        response.setMessage(message);
        return response;
    }
}